<%--
    Document   : cadastrarUsuario
    Created on : 27/11/2010, 14:47:33
    Author     : Ramayane
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" language="java"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Em Busca de Emprego</title>
        <link rel="stylesheet" type="text/css" href="../css/ebeformatacao.css" />
        <link rel="stylesheet" type="text/css" href="../css/stylesheet.css" />
    </head>
    <body class="fundo">
        <f:view locale="#{idioma.atual}" >

            <!-- inclusao do cabecalho -->
            <f:subview id="cabecalho">
                <jsp:include page="cabecalho.jsp" />
            </f:subview>

            <!-- este bloco de codigo só é exibido se logado=false -->
            <div id="conteudo" >
                <center>
                    <h:panelGrid columns="1" rendered="#{!controlUsuario.logado}" >
                        <div class="colunacabecalho">
                            <h:panelGrid columns="3" rendered="#{!controlUsuario.logado}">
                                <h:form id="teste">

                                    <td> <!--Publicar vagas gratuitamente -->
                                        <h:outputLink value="../paginasjsp/acesso.jsp">
                                            <h:graphicImage  value="../Imagens/#{idioma.atual}/cadastrevaga_postjobs.png"></h:graphicImage>
                                        </h:outputLink>
                                    </td>

                                    <td><!-- Cadastre - se -->
                                        <h:commandLink action="#{controlUsuario.novoUsuario}" styleClass="hiperlink">
                                            <h:graphicImage value="../Imagens/#{idioma.atual}/cadastrese_singup.png"></h:graphicImage>
                                        </h:commandLink>
                                    </td>
                                    <td width="50%"> <!-- Login -->
                                        <div class="login"

                                             <h:form id="frmLogin">
                                                 <div class="textologin">
                                                      <h:panelGrid columns="2">
                                                         <!-- Guarda o usuario no bean usuarioAtual-->
                                                         <h:outputLabel for="usuario" value="#{msgs['index.login']}:" styleClass="labels" />
                                                         <h:inputText id="usuario" value="#{controlUsuario.usuario.cpf}" styleClass="imputText" required="false"/>
                                                         <!-- Guarda a senha na classe autenticaBean-->
                                                         <h:outputLabel for="senha" value="#{msgs['index.senha']}:" styleClass="labels" />
                                                         <h:inputText id="senha" value="#{controlUsuario.usuario.senha}" styleClass="imputText" required="false"/>
                                                         <!-- Value chama o metodo autenticacao-->
                                                     </h:panelGrid>
                                                     <h:commandButton action="#{controlUsuario.autenticar}" value="#{msgs['index.OK']}" styleClass="buttons"/>
                                                     <h:messages styleClass="errorMessage"/>
                                                 </div>
                                             </h:form>
                                        </div>
                                    </td>
                                </div>
                            </center>
                        </h:form>
                    </h:panelGrid>
                </h:panelGrid>



                <!-- este bloco de codigo só será exibido se logado=true -->
                <center>
                    <h:panelGrid columns="2" rendered="#{controlUsuario.logado}">
                        <h:form id="paginaInicial">
                            <!-- cadastrar e publicar vaga -->

                            <td>
                                <h:commandLink action="#{controlVaga.novaVaga}">
                                    <h:graphicImage  value="../Imagens/#{idioma.atual}/cadastrevaga_postjobs.png"></h:graphicImage>
                                </h:commandLink>
                            </td>

                            <td>
                                <h:outputLink value="../paginasjsp/mostrarVagas.jsp">
                                    <h:graphicImage  value="../Imagens/#{idioma.atual}/buscarvaga_jobsearch.png"></h:graphicImage>
                                </h:outputLink>
                            </td>

                        </h:form>
                    </h:panelGrid>
                </center>

                <center class="buscarVagas">
                    <h:form id="buscarVaga">
                        <h:panelGrid columns="2" styleClass="tabelaRich500" columnClasses="alignRight, alignLeft" >
                            <f:facet name="header">
                                <h:panelGrid columns="1" rowClasses="rowDarkGreen" styleClass="tabelaRich500">
                                    <h:outputText value="#{msgs['buscar.informe']}" styleClass="titulos" />
                                </h:panelGrid>
                            </f:facet>

                            <h:outputText value="#{msgs['buscar.estado']}: " />
                            <h:selectOneMenu id="estados" value="#{controlVaga.estadoEscolhido}"
                                             onchange="this.form.submit()">
                                <f:selectItems value="#{controlVaga.estadosExistentes}"
                                               />
                            </h:selectOneMenu>


                            <h:outputText value="#{msgs['buscar.cidade']}: " />
                            <h:selectOneMenu id="cidades" value="#{controlVaga.cidadeEscolhida}">
                                <f:selectItems value="#{controlVaga.cidadesExistentes}" />
                            </h:selectOneMenu>

                            <h:outputText value="#{msgs['buscar.funcao']}: " />
                            <h:selectOneMenu id="funcoes" value="#{controlVaga.funcoesEscolhida}">
                                <f:selectItems value="#{controlVaga.funcoesCadastradas}" />
                            </h:selectOneMenu>


                            <h:outputText value="<br> " escape="false" />
                            <h:outputText value="<br> " escape="false" />

                        </h:panelGrid>
                        <h:panelGrid columns="2" styleClass="tabelaRich500" columnClasses="alignRight, alignCenter, alignLeft" >
                            <h:outputText value="&nbsp;&nbsp;&nbsp;&nbsp;" escape="false" />
                            <h:commandButton value="#{msgs['buscar.pesquisar']}" action="#{controlVaga.pesquisar}" />
                        </h:panelGrid>
                    </h:form>
                </center>
                <h:messages></h:messages>
            </div>
            <f:subview id="rodape">
                <jsp:include page="rodape.jsp" />
            </f:subview>
        </f:view>
    </body>
</html>
